In [1]:
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
sns.set_style('whitegrid')

In [2]:
from hybridpy.learning import dynamicprogramming
from hybridpy.dataset import triploader

In [3]:


In [4]:


In [24]:
trip = triploader.load('/Users/astyler/projects/ChargeCarData/thor/thor20100305_1.csv')
controls = [0, 5000, 10000, 15000, 20000, 25000, 40000]
v, q, p, tp = dynamicprogramming.compute(trip=trip, controls=controls, soc_states=100)

In [25]:
plt.figure(figsize=(10,8))
sns.heatmap(v.T[::-1], linewidth=0, robust=True, cmap='RdBu_r')


Out[25]:
<matplotlib.axes._subplots.AxesSubplot at 0x10f2c7750>

In [8]:
plt.plot(v.T[0:10].T)


Out[8]:
[<matplotlib.lines.Line2D at 0x111e96cd0>,
 <matplotlib.lines.Line2D at 0x111e964d0>,
 <matplotlib.lines.Line2D at 0x111e8de10>,
 <matplotlib.lines.Line2D at 0x111e8db90>,
 <matplotlib.lines.Line2D at 0x111e8d4d0>,
 <matplotlib.lines.Line2D at 0x111e80150>,
 <matplotlib.lines.Line2D at 0x112efa710>,
 <matplotlib.lines.Line2D at 0x111e804d0>,
 <matplotlib.lines.Line2D at 0x111e77850>,
 <matplotlib.lines.Line2D at 0x111e77d90>]

maybe interp1d with a inf in y values, one inf at 1137, and all before are now NAN, including at other SOCS. no at 1136, 0 is nan but full soc still has value

one nan at the bottom is back propping up, ~1 soc per timestep from interpolation

check interp1d with nan values... check min q t is correct?


In [13]:
from scipy.signal import butter, filtfilt
import numpy as np

In [23]:
plt.subplot(111)
plt.plot(trip.Acceleration)
plt.figure(figsize=(12,8))
#plt.plot(trip.Power)
plt.plot(p)


Out[23]:
[<matplotlib.lines.Line2D at 0x110e50fd0>]

In [ ]: